package xm.control.bar.barContent
{
	import flash.display.DisplayObject;
	
	import xm.control.bar.base.BarBase;
	import xm.control.bar.base.ContentBase;
	
	/**
	 * <br> 클래스 설명 : </br>
	 * @author 김정환
	 */	
	public class ActionContent extends ContentBase
	{
		
		//-----------------------------------------------------------------------------------
		// public vars
		//-----------------------------------------------------------------------------------
		
		
		
		
		//-----------------------------------------------------------------------------------
		// protected / internal vars
		//-----------------------------------------------------------------------------------
		
		
		
		
		//-----------------------------------------------------------------------------------
		// private vars
		//-----------------------------------------------------------------------------------
		
		
		
		
		//-----------------------------------------------------------------------------------
		// public functions
		//-----------------------------------------------------------------------------------
		
		/**
		 * constructor 
		 */	
		public function ActionContent()
		{
			super();
		}
		
		
		/**
		 * @param s
		 * @param rect
		 */		
		override public function apply( container:BarBase ):void
		{
			super.apply( container );
			
			var i:int, len:int, content:DisplayObject, sum:Number;
			
			i=0;
			len = contentList.length;
			sum = 0;
			
			while( i<len )
			{
				content = contentList[ i ] as DisplayObject;
				if( content != null )
				{
					content.x = Math.round( container.viewWidth - content.width - paddingRight ) + sum;
					content.y = Math.round( ( container.viewHeight - content.height ) / 2 + paddingTop );
					
					sum -= content.width + gapBetweenContents;
				}
				++i;
			}
		}
		
		//-----------------------------------------------------------------------------------
		// life cycle functions
		//-----------------------------------------------------------------------------------
		
		/**
		 * 변수, 객체 생성됨.
		 */		
		override public function createChildren():void
		{
			super.createChildren();
		}
		
		/**
		 * 생성완료시점.
		 */		
		override public function creationComplete():void
		{
			super.createChildren();
		}
		
		/**
		 * 화면에 add됨.
		 */		
		override public function add():void
		{
			super.add();
		}
		
		/**
		 * 화면에서 remove됨. 
		 */		
		override public function remove():void
		{
			super.remove();
		}
		
		/**
		 * 메모리에서 destory됨. 
		 */		
		override public function destroy():void
		{
			super.destroy();
		}
		
		
		//-----------------------------------------------------------------------------------
		// setter / getter
		//-----------------------------------------------------------------------------------
		
		
		
		//-----------------------------------------------------------------------------------
		// protected functions
		//-----------------------------------------------------------------------------------
		
		
		
		//-----------------------------------------------------------------------------------
		// internal functions
		//-----------------------------------------------------------------------------------
		
		
		
		
		//-----------------------------------------------------------------------------------
		// private functions
		//-----------------------------------------------------------------------------------
		
		
		
		//-----------------------------------------------------------------------------------
		// event handler
		//-----------------------------------------------------------------------------------
		
		
		
		
		
		
		
		
		
	}
}